Skip to content

feat: Enhance infinite scrolling to use action button for load more data#39792

Merged
jacquesikot merged 13 commits intoreleasefrom
feat/infinite-scroll-load-more-button
Mar 24, 2025
Merged

feat: Enhance infinite scrolling to use action button for load more data#39792
jacquesikot merged 13 commits intoreleasefrom
feat/infinite-scroll-load-more-button

Conversation

@jacquesikot
Copy link
Contributor

@jacquesikot jacquesikot commented Mar 19, 2025

Summary

This PR replaces the automatic infinite scrolling behavior in TableWidgetV2 with an explicit "Load More" button. This change improves user experience by:

  • Giving users more control over when additional data is loaded
  • Making the loading process more intentional

Changes

Removed Dependencies

  • Removed react-window-infinite-loader dependency as it's no longer needed with the new approach

Key Implementation Details

  • Added a "Load More" button that appears at the bottom of the table when more data is available
  • Simplified virtualization logic by removing automatic loading triggers
  • Improved the initial load experience by pre-loading two pages of data when possible
  • Made the loading state more explicit and user-controlled

Technical Implementation

  • Modified VirtualList.tsx to include a "Load More" button row when more data is available
  • Refactored useInfiniteVirtualization hook to track data availability without automatic loading
  • Updated InfiniteScrollBody component to pass the necessary props for the load more functionality
  • Maintained virtualization for performance while changing only the loading trigger mechanism

Fixes #39084

Automation

/ok-to-test tags="@tag.Widget, @tag.Sanity, @tag.Binding"

🔍 Cypress test results

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/13971123087
Commit: 42733b8
Cypress dashboard.
Tags: @tag.Widget, @tag.Sanity, @tag.Binding
Spec:


Thu, 20 Mar 2025 15:41:02 UTC

Communication

Should the DevRel and Marketing teams inform users about this change?

  • Yes
  • No

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Introduced a dynamic “Load More” option within data views, allowing users to load additional results seamlessly.
    • Added a new LoadMoreButton component for enhanced user interaction when loading more records.
    • Added a constant for the "Load More" label to enhance user interface consistency.
  • Refactor

    • Streamlined infinite scrolling functionality for smoother data navigation and improved responsiveness during data loading.
    • Simplified data handling logic in the infinite scrolling component for enhanced performance.
    • Enhanced the row rendering logic to improve user experience with data loading.
    • Removed unnecessary imports and interfaces to clean up the codebase.
    • Adjusted component parameters for better integration of loading state and pagination.
  • Tests

    • Added a new test suite for validating the functionality of the updated virtual list component.
    • Removed outdated test cases to streamline testing efforts.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement New feature or request ok-to-test Required label for CI Query Widgets & IDE Pod All issues related to Query, JS, Eval, Widgets & IDE Table Widget V2 Issues related to Table Widget V2 Task A simple Todo Widgets & Accelerators Pod Issues related to widgets & Accelerators Widgets Product This label groups issues related to widgets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement(or handle) loading row for seamless data fetch experience [Stretch goal for spring Mar10-Mar21]

2 participants